package com.tarena.charging.user.repository;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tarena.charging.user.mapper.UserMapper;
import com.tarena.charging.user.pojo.po.UserPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

@Repository
public class UserRepository extends ServiceImpl<UserMapper, UserPO> {
    @Autowired
    private UserMapper userMapper;

    public UserPO getUserByOpenId(String openId) {
        QueryWrapper<UserPO> queryWrapper=new QueryWrapper<>();
        queryWrapper.eq("wx_open_id",openId);
        return userMapper.selectOne(queryWrapper);
    }
}
